/*
 * @FileName: [PosService.java] 
 * @Package com.bcinfo.iccard.service 
 * 
 * 
 * Copyright (c) 2011-2015 BCINFO Technology Limited Com.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary 
 * information of BCINFO Technology Limited Company
 * ("Confidential Information"). You shall not disclose 
 * such Confidential Information and shall use it only
 * in accordance with the terms of the contract agreement 
 * you entered into with RKY.
 * 
 * $Rev: 554 $
 * $LastChangedDate: 2013-12-17 19:57:15 +0800 (Tue, 17 Dec 2013) $
 * $LastChangedBy: wanggc $
 * 
 * @category ICCARD
 * @version 1.1
 * @author $Author: wanggc $
 *
 * Change History:[Formatter: author date description] <br/>
 * 1
 * 2
 * 3
*/


package com.bcinfo.iccard.service;

import com.bcinfo.iccard.exception.IccardDatabaseException;
import com.bcinfo.iccard.model.Merchant;
import com.bcinfo.iccard.model.Pos;

/**
 * POS服务 <br/>
 * <p>Description:<br/>
 *    <p>TODO 详细描述
 *
 * <p>For Examples <br/>
 * <PRE>
 *      TODO 代码使用示例
 * </PRE>
 * <p>
 */
public interface PosService
{
    /**
     * 按ID查询pos信息
     *  <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-3-下午03:24:23<br/>
     * <p>
     * @param posId POS机ID
     * @return   
     *
     */
    Pos load(long posId) throws IccardDatabaseException;
    /**
     * 按POS机编码查询
     *  <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-3-下午03:24:59<br/>
     * <p>
     * @param posCode POS机编码
     * @param merchantCode 商家编码
     * @return   
     *
     */
    Pos loadByCode(String posCode,String merchantCode) throws IccardDatabaseException;
    /**
     * 添加POS机
     * 一句话描述 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-3-下午03:25:49<br/>
     * <p>
     * @param pos
     * @return   
     *
     */
    Pos add(Pos pos) throws IccardDatabaseException;
    /**
     * 更新POS机信息
     *  <br/>
     * <p>Description: TODO(POS机基本信息不变，更新对应的PINKey及 MACKEY) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-3-下午03:27:07<br/>
     * <p>
     * @param pos
     * @return   
     *
     */
    int update(Pos pos) throws IccardDatabaseException;
    /**
     * 删除商家所有POS
     *  <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-3-下午03:25:17<br/>
     * <p>
     * @param merchantId 商家标识
     * @return   
     *
     */
    int deleteByMerchant(long merchantId) throws IccardDatabaseException;
    
    /**
     * 按商家编号进行查询商家信息
     *  <br/>
     * <p>Description: 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-16-下午04:27:36<br/>
     * <p>
     * @param merchantEncode 商家编码
     * @return   
     *
     */
    Merchant loadByMerchantEncode(String merchantEncode) throws IccardDatabaseException;
    /**
     * 生成流水号
     *  <br/>
     * <p>Description:为充值卡消费和二维码消费生成流水号 
     * <br/>流水号全局唯一
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-17-下午04:51:07<br/>
     * <p>
     * @return 流水号
     * @throws IccardDatabaseException   
     *
     */
    String generateSerialNum() throws IccardDatabaseException;
}
